#include "mainwindow.h"
#include <QMutex>
#include <QSemaphore>
#include <QApplication>
#include <signal.h>
MainWindow *w;

void handle_sigint(int signum) {
    std::cout << "Caught signal " << signum << " (Ctrl+C). Cleaning up..." << std::endl;
    // 在这里执行清理操作
    delete w;
    exit(0);  // 退出程序
}

QMutex mutex;
QSemaphore semaphore(1);
QSemaphore semaphore_CAPTURE(0);

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    w = new MainWindow;
    signal(SIGINT, handle_sigint);

    w->show();
    return a.exec();
}
